#pragma once
#include "..\IDGGSKernel.hpp"

_NNU_DGGS_BEGIN
    namespace Kernel::Projection
    {
        class ISEA;
    }
    using namespace Kernel::Projection;
    namespace Kernel::ISEA4D
    {
        class ISEA4DQuery;
        class ISEA4DImpl : public IDGGSKernel
        {
        public:
            //初始化
            void init() override;

            void release() override;

            //编码转地理坐标
            bool decode(DGGSElementCode code, GeoCoord& coords) override;
            //地理坐标转编码
            bool encode(GeoCoord coords, DGGSElementCode& code) override;
            //拓扑查询
            bool query(DGGSTopoType queryType, DGGSElementCode code, DGGSElementCodeIter*& iter, int& elementNum) override;

        private:
            //体的拓扑查询
            bool voxelTopoQuery(DGGSTopoType queryType, DGGSElementCode code, DGGSElementCode*& codes, int& elementNum);
            //面的拓扑查询
            bool cellTopoQuery(DGGSTopoType queryType, DGGSElementCode code, DGGSElementCode*& codes,int& elementNum);
            //线的拓扑查询
            bool edgeTopoQuery(DGGSTopoType queryType, DGGSElementCode code, DGGSElementCode*& codes, int& elementNum);
            //点的拓扑查询
            bool vertexTopoQuery(DGGSTopoType queryType, DGGSElementCode code, DGGSElementCode*& codes, int& elementNum);
            //拓扑查询类
            ISEA4DQuery* DGGSquery=NULL;
            //投影类
            ISEA* isea=NULL;
            //格网类型
            DGGSGridType gridType = DGGSGridType::DGGS_ISEA4D;

            int level = 0;
        };
    }
_NNU_DGGS_END

